package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.query.album.TrackInfoQuery;
import com.atguigu.tingshu.vo.album.AlbumTrackListVo;
import com.atguigu.tingshu.vo.album.TrackListVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface TrackInfoMapper extends BaseMapper<TrackInfo> {


    /**
     * 查询声音列表
     * @param trackInfoPage
     * @param trackInfoQuery
     * @return
     */
    IPage<TrackListVo> selectUserTrackPage(Page<TrackListVo> trackInfoPage, @Param("vo") TrackInfoQuery trackInfoQuery);

    /**
     * 获取专辑声音列表
     * @param albumTrackListVoPage
     * @param albumId
     * @return
     */
    IPage<AlbumTrackListVo> selectAlbumTrackPage(Page<AlbumTrackListVo> albumTrackListVoPage, @Param("albumId") Long albumId);

    /**
     * 更新声音播放量
     * @param trackId
     * @param statType
     * @param count
     */
    void updateTrackStat(@Param("trackId") Long trackId, @Param("statType") String statType, @Param("count") Integer count);

}
